package mspbots.timedoctor.client.core.api;

import com.fasterxml.jackson.databind.JsonNode;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * data.connector.timedoctor.ResultMessageModel
 *
 * @author Alex bob(https://github.com/vnobo)
 * @date Created by 2020/3/26
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ResultMessageModel implements Serializable {

    private MessageModelAction action;
    private MessageModelType type;
    private JsonNode entity;
    private LocalDateTime sendTime;
    private Long tenantId;

    public enum MessageModelType {
        COMPANIES, TASKS, USERS, WORKLOGS, PAYROLLS, PROJECTS
    }

    public enum MessageModelAction {
        ADD, DELETE, UPDATE
    }
}
